<extend name="base/layout" />
<block name="title">支付方式</block>
<block name="style">
    <link href="__TMPL__/public/weui/example.css" rel="stylesheet">
</block>
<block name="main">
    
</block>
<block name="footer">
    <script type="text/html" id="tpl_home">
        <div class="page">
            <div class="page__bd">
                <div class="weui-cells" style="margin-top:0;padding:10px 0px;">
	            <a class="weui-cell weui-cell_access" href="javascript:;">
	                <div class="weui-cell__bd">
	                    <p>交易金额</p>
	                </div>
	                <div class=""><b style="color:#000;font-size: 20px;">￥{$total}</b></div>
	            </a>
        		</div>
                <div class="weui-cells">
                    <div class="weui-panel__hd">选择支付通道</div>
                    <div class="weui-panel__bd">
                    	<?php if($aisles):?>
                    	<?php foreach($aisles as $aisle):?>
                        <div>
                        	<a class="weui-cell weui-cell_access page_item " data-id="bankpage" data-payment="{$aisle['aisle_id']}" href="javascript:;" style="position: relative;">
	                            <div class="weui-cell__bd weui-cell_primary">
	                                <h4 class="weui-media-box__title paymeng-title">{$aisle['title']}</h4>
	                                <p class="weui-media-box__desc">
	                                    <div class="weui-flex pay-desc">
	                                        <div class="weui-flex__item">限额：{$aisle['quota']}</div>
	                                        <div class="weui-flex__item">时间：{$aisle['time']}</div>
	                                    </div>
	                                    <div class="weui-flex pay-desc">
	                                        <div class="weui-flex__item">结算：{$aisle['settle']}</div>
	                                        <div class="weui-flex__item">费率：{$aisle['rate']}</div>
	                                    </div>
	                                    <div class="pay-desc2">{$aisle['tishi']}</div>
	                                </p>
	                            </div>
	                            <span class="weui-cell__ft"></span>
	                            <?php if($aisle['disbale'] == 1):?>
	                            <div class="payment-disbale"></div>
	                            <?php endif;?>
	                        </a>
                        </div>
                        <?php endforeach;?>
                        <?php endif;?>
                         
                    </div>
                    
                </div>
            </div>  
        </div>

        <script type="text/javascript">
            $(function(){
                var winH = $(window).height();
                var categorySpace = 10;
                $('.page_item').on('click', function(){
                    var _this = $(this)
                    if(_this.find(".payment-disbale").hasClass("payment-disbale")){
                    	return false;
                    }
                    var id = _this.data('id');
                    var payment_id = _this.data('payment');
                    
                    window.pageManager.go(id,function(res){
                    	console.log(payment_id)
                    	$("#_paymentId").val(payment_id)
                    	$("#payment-label").html(_this.parent().html());
                    });
                });
                
            });
        </script>
    </script>                   
    <script type="text/html" id="tpl_bankpage">
    <div class="page">
    <div class="page__bd ">
    	<div id="payment-label"></div>
    	<form action="" id="_form">
    		<input type="hidden" name="payment_id" id="_paymentId" value="0">
    		<input type="hidden" name="total" id="_total" value="{$total}">
	        <div class="weui-cells weui-cells_checkbox">
	        	<?php if($cards):?>
	        	<?php foreach($cards as $card):?>
	            <label class="weui-cell weui-check__label" for="s{$card['id']}" >
	                <div class="weui-cell__hd">
	                    <input type="radio" class="weui-check" name="cardId" id="s{$card['id']}" value="{$card['id']}">
	                    <i class="weui-icon-checked"></i>
	                </div>
	                <div class="weui-cell__bd">
	                    <p>{$card['openBankName']}</p>
	                    <p class="pay-desc2">*******{:substr($card['bankAccountNo'],-4)} {$card['bankAccountName']}</p>
	                </div>
	            </label>
	            <?php endforeach;?>
	            <?php endif;?>
	            
	           
	        </div>
	        <br/><br/><br/>
	        <div class="page__bd_spacing">
	        <a href="javascript:;" class="weui-btn weui-btn_primary ajax-submit">确定</a>
	    </div>
	</form>
    </div>
    
</div>

</script>

</script>
<script type="text/javascript" src="__TMPL__/public/weui/example.js"></script>
</block>
